home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
science
/
fastmap.zip
/
FASTMAP.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-16
|
5KB
|
147 lines
/* FASTMAP.H */
/* Copyright (C) David Curtis 1992 */
#ifndef FASTMAP_H
#define FASTMAP_H
#ifdef __ZTC__
#define __ZORTECH__ 1
#endif
#ifndef __SUN__
#define __SUN__ 0
#endif
#ifndef __ZORTECH__
#define __ZORTECH__ 0
#endif
#ifdef __STDC__
#define CAN_PROTOTYPE 1
#define USE_ENUMS 1
#endif
#ifndef CAN_PROTOTYPE
#define CAN_PROTOTYPE 0
#endif
#ifndef USE_ENUMS
#define USE_ENUMS 0
#endif
#if __ZORTECH__
/* I know I can do this even if not ANSI C */
#undef CAN_PROTOTYPE
#define CAN_PROTOTYPE 1
#undef USE_ENUMS
#define USE_ENUMS 1
#endif
#if CAN_PROTOTYPE
#define PROTO(args) args
#else
#define PROTO(args) ()
#endif
#include <stdio.h>
/* for FILE* */
#define MAXPEDS 100
#define MAXMARKERS 30
#define MAXPAIRS 10
#define MAXDISTS 50
#define MINFRACTION 0.01
struct lod_rf_t {
float rf,lod;
};
/* pair of values for recombination fraction and lod score to be input
by user */
struct marker_t {
float prob_inf;
float *nonrec,*rec,position;
char name[21];
float fraction_used;
struct lod_rf_t **lods;
int *npairs;
};
/* probability of marker being informative at a given locus, estimated
numbers of nonrecombinant and recombinant meioses for each pedigree,
marker name, fraction of total meioses for which it is informative,
table of input pairs of values for recombination fraction and lod, and
the number of theses pairs for each pedigree */
struct info2p_t_s {
float rec,nonrec,position,fraction_used,null_like;
};
typedef struct info2p_t_s info2p_t;
/* information about meioses for which one marker only is informative,
with marker position, the fraction of the total meioses this is and the
likelihood associated with these data at a recombination fraction of
50% (to save recalculating for each desired lod score */
struct info3p_t_s {
float rrnn[4],l_position,r_position,null_like;
};
typedef struct info3p_t_s info3p_t;
/* as above, but for meioses informative for markers on both sides of
the disease locus */
extern float reliability[MAXPEDS];
extern struct marker_t disease,*marker;
extern FILE *input_file,*output_file,*graph_file,*debug_file;
extern int num_points,num_peds;
extern float mind,maxd;
extern float **tablods,*totlods;
extern float fixdist[MAXDISTS];
extern int nfixdist;
extern float total_meioses[MAXPEDS];
extern int init_marker PROTO((struct marker_t *m,int nfams));
extern float get_prob_inf PROTO((float freq[],int nall));
extern float anti_kosambi PROTO((double dist));
extern float estimate_total_meioses PROTO((struct marker_t marker[],int num_markers,int pednum));
extern float log_bin_like PROTO((double x,double N,double a));
extern void clear_2p PROTO((info2p_t *m));
extern void set_null_like_2p PROTO((info2p_t *m));
extern void set_null_like_3p PROTO((info3p_t *mm));
extern float lod_3p PROTO((struct marker_t *d,info3p_t *mm,double rel));
extern float lod_2p PROTO((struct marker_t *d,info2p_t *m,double rel));
extern float inf_rf_between PROTO((info2p_t *r,info2p_t *l));
extern int meioses_from_lods PROTO((int numf,int num_markers));
extern void info_from_marker PROTO((info2p_t *d,struct marker_t *s,int pednum));
extern void sort_two_infos PROTO((info2p_t *l,info2p_t *r,float result[9]));
extern void fix_fraction_used PROTO((info2p_t *i,double tm));
extern void fill_info3p PROTO((info3p_t *p,info2p_t *l,info2p_t *r,float *rrnn));
extern char *get_line PROTO((char *line,int maxlen));
extern void prompt PROTO((char *s));
extern input_marker PROTO((struct marker_t *m,int num_peds));
extern float get_nr_from_lods PROTO((struct marker_t *m,int ped,double rel));
extern input_data PROTO((void));
extern open_files PROTO((void));
extern set_up_tables PROTO((int num_peds,int num_points));
extern input_disease_info PROTO((struct marker_t *d));
extern get_num_fams PROTO(());
extern error_func PROTO((unsigned l,char *f,char *s1,char *s2));
extern calculate_lods PROTO((double mind,double maxd,int num_points,struct marker_t *disease,
struct marker_t marker[],int num_markers));
extern make_map PROTO((double mind,double maxd,int num_points,struct marker_t *disease,
struct marker_t marker[],int num_markers,int pednum));
extern void output_tables PROTO((int num_peds,int num_points,int num_markers,
double mind,double maxd));
extern float get_rf_fraction PROTO((struct lod_rf_t pairs[],int npairs,
double rel,float *ssq,double tol));
extern float err_num_meioses PROTO((double N));
extern float get_num_meioses PROTO((struct lod_rf_t[],int,double inf,double ratio));
extern float err_rf_fraction PROTO((struct lod_rf_t[],int,double,double));
extern void print_consts PROTO((void));
#endif